package com.xqledu.admin.entry.request;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description: 分页request
 * @author: 向其林
 * @date: 2023/5/7 0007 19:45
 * @version: 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageRequest {

    private Integer pageNum;

    private Integer pageSize;

    private String sort;

    private static final String ORDER = "desc";

    public Integer getPageNum() {
        return pageNum = pageNum == null ? 0 : pageNum;
    }

    public Integer getPageSize() {
        return pageSize = pageSize == null ? 10 : pageSize;
    }

    public String getSort() {
        return sort = sort == null ? ORDER : sort;
    }
}
